package com.wuxin.config;


import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @program: jinrongxiangmu
 * @ClassName ContantsProperties
 * @description: 解析配置文件中自定义的配置 oss
 * @author: 李尧坤
 * @create: 2025−01-17 08:36
 * @Version 1.0
 **/

@Component
public class ContantsProperties implements InitializingBean {
    @Value("${aliyun.oss.endpoint}")
    private String endpoint;  //区域

    @Value("${aliyun.oss.accessKeyId}")
    private String accesskeyid; // key

    @Value("${aliyun.oss.secret}")
    private String accesskeyssecret; // 密钥

    @Value("${aliyun.oss.bucket}")
    private String backeName;

    public static  String ENDPOINT;
    public static  String ACCESS_KEY_ID;
    public static  String ACCESSKEY_SSECRET;
    public static  String BUCKET_NAME;


    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT=endpoint;
        ACCESS_KEY_ID=accesskeyid;
        ACCESSKEY_SSECRET=accesskeyssecret;
        BUCKET_NAME=backeName;
    }
}
